#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/socket.h>

#define DeviceName "my_cdev"
#define CMD_IOC_MAGIC 'k' //自定义类型，应用层与驱动应一样
#define CMD_RESET _IO(CMD_IOC_MAGIC, 0)
//#define CMD_WRITE		_IOR(CMD_IOC_MAGIC, 1, int)//int表示交互数据类型为int
//#define CMD_READ		_IOW(CMD_IOC_MAGIC, 2, int)
#define CMD_WRITE _IOR(CMD_IOC_MAGIC, 1, int) // char*表示交互数据类型为char*
#define CMD_READ _IOW(CMD_IOC_MAGIC, 2, int)
#define DATALEN 4096

